Manage Inheritance Variables

This section describes inheritance variables and the associated commands.

Inheritance variables are variables that can be transferred from a parent session Uproc to child session Uprocs. As oppose to Uproc variables, inheritance variables do not have a size limit and do not have to be declared in the Uproc settings. Once an inheritance variable is entered in the Uproc script it is automatically transferred to the child Uproc when the session is run.

All Uproc types do not support inheritance variables.

The uxset inheritance keep|discard command specifies whether input variables are transferred to the child Uprocs or not. Its syntax is as follows:

uxset inheritance keep|discard

The uxset hvar command can be used to create an inheritance variable, assign a value to this variable and specify that this variable will be transferred to the child Uprocs. Its syntax is as follows:

uxset hvar VAR=VAL

The uxunset hvar command specifies which variables will not be transferred to the child Uprocs. Its syntax is as follows:

uxunset hvar VAR

Description of Items

Constraints on the variable value

During the transmission to the next Uproc, inheritance variables are created as environment variables into the system (by the u_batch of the next Uproc), so the value of an inheritance variable has to contain the same characters than the ones authorized for the value of an environment variable on the given OS (the command set is used to set an environment variable for Windows, and the command export is used for UNIX). Otherwise, the inheritance variable cannot be created as an environment variable by the system, and the Uproc aborts.

Example 1: The following inheritance variables set into the script of a Uproc are correct:

uxset hvar "MY_VAR1=email<who@hello.com>"

or

uxset hvar MY_VAR1="email<who@hello.com>"

This variable will be created as an environment variable on the system by DUAS. This corresponds to the following correct system commands:

On Windows:

C:\>set MY_VAR1="email<who@hello.com>"

On UNIX:

root@myunixmachine:/# export MY_VAR1="email<who@hello.com>"

Example 2: The following inheritance variable set into the script of a Uproc is not correct:

uxset hvar MY_VAR1=email<toto@hello.com>

This variable cannot be created as an environment variable by DUAS. This corresponds to the following incorrect system commands:

On Windows:

C:\>set MY_VAR1=email<who@hello.com>

The syntax of the command is incorrect

On UNIX:

root@myunixmachine:/# export MY_VAR1=email<who@hello.com>

-bash: syntax error near unexpected token `newline'

If the value contains non alphanumeric characters, these characters must be preceded by the "\" character.

Display of Inheritance Variables

With the exception of WS_SOAP and WS_REST type Uprocs, inheritance variables are not listed in UVC. To view the transmitted variables, open the job log of the child Uproc.

Example:

$!**  INHERITANCE VARIABLES

            var1: val12345

_!================================================

If the option to keep the variables is activated (by default or command uxset inheritance keep), inheritance variables will be transmitted. If the option to keep the variables is deactivated (command uxset inheritance discard), the variables will not be transmitted to the child Uproc.

If the user references a variable that already exists (name conflict), the variable's value set in the category with a higher priority (1 is the highest) is selected. The categories are the following:

  1. Variable created in the script
  2. Standard variable (S_NODENAME, S_AREA, S_NUMLANC)
  3. Launch variable
  4. Task variable
  5. Uproc variable
  6. Inheritance variable
  7. MU variable
  8. Node variable
  9. Variable defined in U_ANTE_UPROC
  10. Variable defined in unienv

Examples

We have three Uprocs in a session (A, B and C). A is the parent Uproc and B and C are the child Uprocs. Run the following command in the script of Uproc A to generate inheritance variables:

uxset hvar Var1=Val1A Var2=Val2A Var3=Val3A

Uproc A variables: Var1=Val1A, Var2=Val2A, Var3=Val3A

In this configuration, be default the variables Var1, Var2 and Var3 and their values will be transmitted to all child Uprocs in the Session.

If the command “uxset inheritance discard” is executed in the script of Uproc A, no input variables will be transferred to Uproc B.

If the command “uxset inheritance keep” is executed in the script of Uproc A, Uproc B will receive all transferred input variables.

If the command “uxunset hvar Var1 Var3” is executed in the script of Uproc A, Uproc B will just receive the variable Var2 with the value “Val2A”.